<#escape x as x?html>
<!DOCTYPE html>
<html>
    <@y.htmlHead type="login"></@>
<body>
<#--<div class="login-box" style="background-image: url('${assetsPath}/img/login_user_background.png');">-->
<preload-01></preload-01>
<div class="login-panel" style="background-image: url('${assetsPath}/img/login_background.png')">
    <div style="padding-left: 235px; padding-top: 205px; width: 500px">
        <form action="${contextPath}/login" method="post" id="userForm" style="padding-top: 45px;">
            <input type="hidden" name="target" value="user">
            <div class="input_label">账号：</div>
            <div class="form-group has-feedback">
                <span class="glyphicon glyphicon glyphicon-user form-control-feedback"></span>
                <input type="text" class="form-control" name="username" placeholder="用户名">
            </div>
            <div class="input_label">密码：</div>
            <div class="form-group has-feedback">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                <input id="loginPwd" type="password" class="form-control" name="password" placeholder="密码">
            </div>
            <div class="checkbox icheck" style="margin-bottom: 60px">
                <div style="float:left"><input type="checkbox" name="rememberMe"></div>
                <div style="float: left; margin-left: 5px;color: grey;">
                    记住账号
                </div>
            </div>
            <button type="submit" class="btn btn-primary btn-block btn-flat" onclick="return check()">登 录</button>
        </form>
    </div>
</div><!-- /.login-box -->
<div id="footerbox">
    <img src="${assetsPath}/img/login_footer.png"></div>
</div>
</body>
<script>
    context.call([
        "jQuery",
        "select2",
        "bootstrap",
        "iCheck"
    ], function () {
        $(".select2").select2({
            placeholder: "选择集群",
            allowClear: false
        });
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' // optional
        });
        $("#userLoginBtn").click(function () {
            $(".login-panel").css("background-image", "url('${assetsPath}/img/login_user_background.png')");
            $("#userForm").css("display", "block");
            $("#managerForm").css("display", "none");
        });
        $("#managerLoginBtn").click(function () {
            $(".login-panel").css("background-image", "url('${assetsPath}/img/login_manager_background.png')");
            $("#userForm").css("display", "none");
            $("#managerForm").css("display", "block");
        });
    });

    function check() {
        // var pwd = $("#loginPwd").val();
        //
        // if (pwd.length < 8){
        //     alert("密码长度至少8位");
        //     $("#loginPwd").val("");
        //     return false;
        // }
        // var regUpper = /[A-Z]/;
        // var regLower = /[a-z]/;
        // var regNum = /[0-9]/;
        // var regTeShu =new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？+-]");
        // var complex = 0;
        // if (regLower.test(pwd) || regUpper.test(pwd)) {
        //     ++complex;
        // }
        // if (regNum.test(pwd)) {
        //     ++complex;
        // }
        // if(regTeShu.test(pwd)){
        //     ++complex;
        // }
        //
        // if (complex < 2){
        //     alert("密码从字符（a-z，A-Z）、数字（0-9）、符号（~！@#$%^&*()_<>）中至少选择两种进行组合")
        //     $("#loginPwd").val("");
        //     return false;
        // }
        $("form").submit();
    }

</script>
<link rel="stylesheet" href="${modulesPath}/user/login.css">
</html>
</#escape>